package com.yh.csx.event.resource;

import com.yh.csx.business.api.entity.CommonResponse;
import com.yh.csx.business.api.entity.Page;
import com.yh.csx.event.domain.gateway.IEventGateway;
import com.yh.csx.event.store.event.IEventServiceApi;
import com.yh.csx.event.store.event.dto.req.EventReq;
import com.yh.csx.event.store.event.dto.resp.EventResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangsheng
 * @date 2021/8/23 10:26
 */
@RestController
public class EventResource implements IEventServiceApi {

    @Autowired
    private IEventGateway eventGateway;

    @Override
    public CommonResponse<Page<EventResp>> queryEvents(EventReq req) {
        return CommonResponse.success(eventGateway.queryEvents(req));
    }

    @Override
    public CommonResponse<String> rePush(String eventId) {
        return CommonResponse.success(eventGateway.rePush(eventId));
    }


}
